package com.gmall.user.controller;

import com.gmall.common.result.Result;
import com.gmall.model.user.UserInfo;
import com.gmall.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;
    @GetMapping("getUserInfoByLoginName/{loginName}")
    public Result<UserInfo> getUserInfoByLoginName(@PathVariable String loginName){
        UserInfo userInfo = userInfoService.getUserInfoByLoginName(loginName);
        return Result.ok(userInfo);
    }
}
